package com.example.demo.refactor.price;

import com.example.demo.refactor.Movie;

/**
 * @author dhc
 * @title: NewReleasePrice
 * @projectName demo
 * @description: TODO
 * @date 2020-10-09 11:51
 */
public class NewReleasePrice extends Price {
    @Override
    public int getPriceCode() {
        return Movie.NEW_RELEASE;
    }

    @Override
    public double getCharge(int dayRented) {
        return dayRented * 3;
    }

    @Override
    public int getFrequentRenterPoints(int dayRented) {
        //add bonus for a two day new release rental
        if (dayRented > 1)
            return 2;
        return 1;
    }
}
